<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script src="${pageContext.request.contextPath}/js/jquery-easyui-1.2.6/jquery-1.7.2.min.js" type="text/javascript"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<a href="${pageContext.request.contextPath}/login_form.htm">登陆</a>
	
	<a href="${pageContext.request.contextPath}/demolistPage.htm">List</a>
	
	<button onclick="testAjax();">AjaxSpring</button>
</body>

<script type="text/javascript">
	function testAjax(){
		var obj = {"name":"pengpeng","person.name":"sxjiang"};
		jQuery.ajax({
			url : '${pageContext.request.contextPath}/index.json',
			contentType : "application/json",//application/xml
			processData : true,//contentType为xml时，些值为false
			dataType : "json",//json--返回json数据类型；xml--返回xml
			data : obj,
			success : function(data) {
				alert(data);
				alert(data.person.name);
			},
			error : function(e) {
				document.write(e);
			}
		});
	}
</script>
</html>